﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Task/Task.master" AutoEventWireup="true"
    CodeFile="NewTaskDetachment.aspx.cs" Inherits="Task_NewTaskDetachment" StylesheetTheme="Content" %>

<asp:Content ID="Content1" runat="Server" ContentPlaceHolderID="ContentPlaceHolder1">

    <script type="text/javascript">
        function CheckDate(Obj) {
            var d = new Date(document.getElementsByName(Obj)[0].value.replace("-", ","));
            var c = new Date();
            if (d < c) {
                document.getElementsByName(Obj)[0].value = c.getFullYear() + "-" + Math.floor(c.getMonth() + 1) + "-" + c.getDate();
                alert("所选日期不能小于当前日期！");
            }
        }

        function EvalDate(Obj1, Obj2) {
            var d1 = new Date(document.getElementById(Obj1).value.replace("-", ","));
            var d2 = new Date(document.getElementById(Obj2).value.replace("-", ","));
            if (d1 > d2) {
                alert("截止日期必须大于开始日期！");
            }
        }
    </script>

    <table border="0" cellpadding="0" cellspacing="0" class="dialog" width="100%">
        <caption>
            <asp:Label ID="ActionTitle" runat="server"></asp:Label></caption>
        <tr>
            <td>
                <div class="line">
                    <span class="label">任务名称：</span><asp:TextBox ID="TaskTitle" runat="server" SkinID="textbox_cn"
                        Width="600px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="ReqTaskTitle" runat="server" ControlToValidate="TaskTitle">必需</asp:RequiredFieldValidator></div>
                <div class="line">
                    <span class="label">任务类型：</span>
                    <asp:RadioButtonList ID="TypeList" runat="server" RepeatDirection="Horizontal">
                    </asp:RadioButtonList>
                </div>
                <asp:UpdatePanel runat="server" ID="upp">
                    <ContentTemplate>
                        <ajaxToolkit:CalendarExtender ID="CalendarExtender_StartDate" runat="server" Format="yyyy-MM-dd"
                            TargetControlID="StartDate" Animated="False">
                        </ajaxToolkit:CalendarExtender>
                        <ajaxToolkit:CalendarExtender ID="CalendarExtender_EndDate" runat="server" Format="yyyy-MM-dd"
                            TargetControlID="EndDate" Animated="False">
                        </ajaxToolkit:CalendarExtender>
                        <div class="line">
                            <span class="label">起止时间：</span><asp:TextBox ID="StartDate" runat="server" SkinID="textbox_en"
                                Width="120px" AutoPostBack="True" OnTextChanged="StartDate_TextChanged"></asp:TextBox>
                            至
                            <asp:TextBox ID="EndDate" runat="server" SkinID="textbox_en" Width="120px" AutoPostBack="True"
                                OnTextChanged="EndDate_TextChanged"></asp:TextBox></div>
                        <div class="line">
                            <span class="label">分数设置：</span>
                            <asp:CheckBox ID="cbNextMonth" runat="server" Text="分数从开始月份下一月开始算起" /><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;
                                说明：适用于开始月份到月未时间太短分数从下月算起</span>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <div class="line">
                    <span class="label">迟报扣分：</span><asp:TextBox ID="txtLadePines" runat="server" SkinID="textbox_en"
                        Width="77px" Text="0"></asp:TextBox>
                    分<span class="comment">&nbsp;&nbsp;&nbsp;&nbsp; 说明：上报时间迟于结束时间所扣分数，若此任务已分解则迟报扣分只能设置于子任务。</span>
                </div>
                <div class="line">
                    <span class="label">任务内容：<br />
                        (首行空4个<br />
                        半角空格)</span><asp:TextBox ID="TaskComment" runat="server" Height="240px" SkinID="textbox_cn"
                            TextMode="MultiLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="ReqTaskComment" runat="server" ControlToValidate="TaskComment">必需</asp:RequiredFieldValidator></div>
                <div>
                    <span class="label">下达单位： </span>
                    <asp:RadioButtonList ID="rblUserType" runat="server" RepeatDirection="Horizontal"
                        AutoPostBack="True" OnSelectedIndexChanged="rblUserType_SelectedIndexChanged">
                        <asp:ListItem Value="0" Selected="True">大队</asp:ListItem>
                        <asp:ListItem Value="1">中队</asp:ListItem>
                    </asp:RadioButtonList>
                </div>
                <asp:UpdatePanel runat="server" ID="UpPanel">
                    <ContentTemplate>
                        <div class="line">
                            <span class="label">执行单位： </span>
                            <asp:CheckBoxList ID="UserList" runat="server" CellPadding="2" RepeatDirection="Horizontal"
                                RepeatColumns="6" Enabled="False">
                            </asp:CheckBoxList>
                        </div>
                        <div class="button">
                            <asp:Button ID="ButtonSave" runat="server" OnClick="ButtonSave_Click" Text="确定" />
                            <asp:Button ID="ButtonCancel" runat="server" CausesValidation="False" OnClick="ButtonCancel_Click"
                                Text="取消" /></div>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <div class="line">
                    <asp:Label ID="Prompt" runat="server"></asp:Label></div>
            </td>
        </tr>
    </table>
</asp:Content>
